Fix numerous instances of shadowing confusion. (#570)
authorGPSBabel <gpsbabel@users.noreply.github.com>
Wed, 27 May 2020 03:31:16 +0000 (22:31 -0500)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 03:31:16 +0000 (22:31 -0500)
commit67bba50a98ea6975eecfd9482f270697a94f7263
tree0536f27aa699e67e949b1112fbc18b84e29e1483
parent8be92e16c59486b7270d53f43b6b93adf3cd21a3
Fix numerous instances of shadowing confusion. (#570)

Fix numerous instances of shadowing confusion.

Inspired by a cppcon talk and our recent conversations about warnings, I
took a closer look at shadowing variables in our code and I wasn't proud
of my findings.

We had a lot of code that was writing to local variables or function
arguments when it thought it was operating on globals or (soon)
method-member variables. I made a rather half-hearted pass at changing
this by splitting up huge functions, renaming arguments, renaming globals
to reflect their future status as method variables (foo_), and generally
cleaning things up. The amound of effort I spent on each format was
approximately equal to its expected lifespan - I'm not spending an hour
on cleanups on formats I should instead be deleting.

In a future submit, I'll try to find some combination of -W flags on
our targets that allows us to not regress easily.
34 files changed:
alan.cc
bcr.cc
brauniger_iq.cc
compegps.cc
dg-100.cc
dmtlog.cc
duplicate.cc
exif.cc
garmin.cc
garmin_gpi.cc
garmin_txt.cc
gdb.cc
ggv_ovl.cc
globalsat_sport.cc
gui/gpsbabel [new file with mode: 0755]
humminbird.cc
igc.cc
ignrando.cc
itracku.cc
jeeps/gpsread.cc
lowranceusr.cc
main.cc
mmo.cc
nmea.cc
osm.cc
pocketfms_bc.cc
raymarine.cc
route.cc
skyforce.cc
stmwpp.cc
unicsv.cc
xmldoc/formats/options/energympro-timezone.xml [new file with mode: 0644]
xmldoc/formats/options/globalsat-timezone.xml [new file with mode: 0644]
xol.cc